home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / include / colormapst.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-15  |  2.9 KB  |  96 lines

  1. /*
  2. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  3. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  4.  
  5.                         All Rights Reserved
  6.  
  7. Permission to use, copy, modify, and distribute this software and its 
  8. documentation for any purpose and without fee is hereby granted, 
  9. provided that the above copyright notice appear in all copies and that
  10. both that copyright notice and this permission notice appear in 
  11. supporting documentation, and that the names of Digital or MIT not be
  12. used in advertising or publicity pertaining to distribution of the
  13. software without specific, written prior permission.  
  14.  
  15. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  16. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  17. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  18. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  19. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  20. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  21. SOFTWARE.
  22.  
  23. */
  24. /* $XConsortium: colormapst.h,v 1.6 88/09/06 15:49:00 jim Exp $ */
  25. #ifndef CMAPSTRUCT_H
  26. #define CMAPSTRUCT_H 1
  27.  
  28. #include "colormap.h"
  29. #include "screenint.h"
  30.  
  31. /* Shared color -- the color is used by AllocColorPlanes */
  32. typedef struct
  33. {
  34.     unsigned short color;
  35.     short  refcnt;
  36. } SHAREDCOLOR;
  37.  
  38. /* LOCO -- a local color for a PseudoColor cell. DirectColor maps always
  39.  * use the first value (called red) in the structure.  What channel they
  40.  * are really talking about depends on which map they are in. */
  41. typedef struct
  42. {
  43.     unsigned short    red, green, blue;
  44. } LOCO;
  45.  
  46. /* SHCO -- a shared color for a PseudoColor cell. Used with AllocColorPlanes.
  47.  * DirectColor maps always use the first value (called red) in the structure.
  48.  * What channel they are really talking about depends on which map they
  49.  * are in. */
  50. typedef struct 
  51. {
  52.     SHAREDCOLOR *red, *green, *blue;
  53. } SHCO;
  54.  
  55.  
  56. /* color map entry */
  57. typedef struct _CMEntry
  58. {
  59.     union
  60.     {
  61.     LOCO    local;
  62.     SHCO    shco;
  63.     } co;
  64.     short    refcnt;
  65.     Bool    fShared;
  66. } Entry;
  67.  
  68. /* COLORMAPs can be used for either Direct or Pseudo color.  PseudoColor
  69.  * only needs one cell table, we arbitrarily pick red.  We keep track
  70.  * of that table with freeRed, numPixelsRed, and clientPixelsRed */
  71.  
  72. typedef struct _ColormapRec
  73. {
  74.     VisualPtr    pVisual;
  75.     short    class;        /* PseudoColor or DirectColor */
  76.     long    mid;        /* client's name for colormap */
  77.     ScreenPtr    pScreen;    /* screen map is associated with */
  78.     short    flags;        /* 1 = IsDefault
  79.                  * 2 = AllAllocated */
  80.     int        freeRed;
  81.     int        freeGreen;
  82.     int        freeBlue;
  83.     int        *numPixelsRed;    
  84.     int        *numPixelsGreen;    
  85.     int        *numPixelsBlue;    
  86.     Pixel    **clientPixelsRed;
  87.     Pixel    **clientPixelsGreen;
  88.     Pixel    **clientPixelsBlue;
  89.     Entry    *red;
  90.     Entry     *green;
  91.     Entry    *blue;
  92.     pointer    devPriv;
  93. } ColormapRec;
  94.           
  95. #endif /* COLORMAP_H */
  96.